<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../common/base_body_header.jsp" %>
<%@include file="../common/navbar.jsp" %>
<%@include file="../common/page_content_pre.jsp" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<link rel="stylesheet" href="${GLOBAL.staticJsPath}/assets/qiniu/fileupload.css"/>

<div class="page-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="widget-box">
                <div class="widget-header">
                    <h4>二手别墅详情</h4>
                </div>

                <div class="widget-body">
                    <div class="widget-main no-padding">
                        <form:form class="form-horizontal" modelAttribute="houseInfo">
                            <fieldset>
                                <div>
                                    <label class="col-sm-1"></label>
                                    <table>
                                        <tr>
                                            <td>小区：</td>
                                            <td>
                                                <form:select path="nbhId" id="nhbId" disabled="true">
                                                    <option value="0" selected=selected>--请选择小区--</option>
                                                    <form:options items="${neighborhoodList}" itemLabel="nbhName"
                                                                  itemValue="nbhId" htmlEscape="false"/>
                                                </form:select>
                                            </td>
                                            <td style="width: 60px;" align="right">楼号：</td>
                                            <td>${houseInfo.cellId}</td>
                                            <td style="width: 60px;" align="right">单元：</td>
                                            <td>${houseInfo.unitNo}</td>
                                            <td style="width: 60px;" align="right">室号：</td>
                                            <td>${houseInfo.roomNo}</td>
                                        </tr>
                                    </table>
                                </div>
                                <br>

                                <div class="form-group">
                                    <label class="col-sm-1"></label>
                                    <table>
                                        <tr>
                                            <td>
                                                <h4>房源基本信息</h4>
                                            </td>
                                            <td style="width: 60px; color: #0b6cbc" align="right">
                                                编号:
                                            </td>

                                            <td style="color: #0b6cbc" align="vertical-align:up;">
                                                    ${houseInfo.houseNo}
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <hr/>

                                <div>
                                    <label class="col-sm-1 control-label"></label>
                                    <table>
                                        <tr>
                                            <td>标题：</td>
                                            <td width="500px">${houseInfo.title}</td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>总价：</td>
                                            <td width="500px">${houseInfo.totalPrice}</td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>类别：</td>
                                            <td>
                                                <form:select class="input-xlarge" path="bulidType" disabled="true">
                                                    <c:forEach items="${fns:getDictList('bs_category')}" var="item">
                                                        <option value="${item.name}"
                                                                <c:if test="${item.name == houseInfo.bulidType}">selected</c:if>>${item.value}</option>
                                                    </c:forEach>
                                                </form:select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                    </table>

                                    <label class="col-sm-1 control-label"></label>
                                    <table>
                                        <tr>
                                            <td>地上：</td>
                                            <td>${houseInfo.overgroundNum}层</td>
                                            <td style="width: 60px;" align="right">地下：</td>
                                            <td>${houseInfo.undergroundNum}层</td>
                                            <td style="width: 60px;" align="right">朝向：</td>
                                            <td>
                                                <form:select path="orientation" disabled="true">
                                                    <c:forEach items="${fns:getDictList('direction')}" var="item">
                                                        <option value="${item.name}"
                                                                <c:if test="${item.name == houseInfo.orientation}">selected</c:if>>${item.value}</option>
                                                    </c:forEach>
                                                </form:select>
                                            </td>
                                            <td style="width: 60px;" align="right">装修：</td>
                                            <td>
                                                <form:select path="decoration" disabled="true">
                                                    <c:forEach items="${fns:getDictList('decorate')}" var="item">
                                                        <option value="${item.name}"
                                                                <c:if test="${item.name == houseInfo.decoration}">selected</c:if>>${item.value}</option>
                                                    </c:forEach>
                                                </form:select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>户型：</td>
                                            <td>${houseInfo.bedroomNum}室${houseInfo.parlorNum}厅${houseInfo.kitchenNum}厨${houseInfo.toiletNum}卫</td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>产证</td>
                                            <td>${houseInfo.permitArea}m²</td>
                                            <td style="width: 60px;" align="right">实际</td>
                                            <td>${houseInfo.factArea}m²</td>
                                            <td style="width: 60px;" align="right">占地</td>
                                            <td>${houseInfo.totalArea}m²</td>
                                            <td style="width: 60px;" align="right">庭院</td>
                                            <td>${houseInfo.gardenArea}m²</td>
                                            <td style="width: 60px;" align="right">地下室</td>
                                            <td>${houseInfo.basementArea}m²</td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td style="width: 60px;">车位：</td>
                                            <td style="width: 60px;">${houseInfo.parkNum}个</td>
                                            <td style="width: 60px;" align="right">建筑年代:</td>
                                            <td><fmt:formatDate value='${houseInfo.buildingYears}'
                                                                pattern='yyyy-MM'/></td>
                                        <tr/>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                    </table>
                                    <label class="col-sm-1 control-label"></label>
                                    <table>
                                        <tr>
                                            <td>业主姓名：</td>
                                            <td style="width: 60px;">${houseInfo.ownerName}</td>
                                            <td style="width: 80px;" align="right">业主电话：</td>
                                            <td>${houseInfo.ownerPhone}</td>
                                            <td style="width: 60px;" align="right">钥匙:</td>
                                            <td>
                                                <c:if test="${houseInfo.keyFlag == '1'}">有</c:if>
                                                <c:if test="${houseInfo.keyFlag == '2'}">无</c:if>
                                            </td>
                                            <td style="width: 60px;" align="right">现状:</td>
                                            <td>
                                                <form:select path="houseCurrent" disabled="true">
                                                    <c:forEach items="${fns:getDictList('house_current')}" var="item">
                                                        <option value="${item.name}"
                                                                <c:if test="${item.name == houseInfo.houseCurrent}">selected</c:if>>${item.value}</option>
                                                    </c:forEach>
                                                </form:select>
                                            </td>
                                        <tr/>
                                    </table>
                                    <label class="col-sm-1 control-label"></label>
                                    <table>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>标签：</td>
                                            <td>
                                                <c:forEach items="${fns:getDictList('label')}" var="item">
                                                    <c:forEach items="${labelList}" var="labeItem">
                                                        <c:if test="${item.name == labeItem}">
                                                            ${item.value}&nbsp;;
                                                        </c:if>
                                                    </c:forEach>
                                                </c:forEach>
                                                <span id="labelSpanId" style="color: red"></span>
                                            </td>
                                        <tr/>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td>创建时间：</td>
                                            <td>&nbsp;${houseInfo.createDate}</td>
                                        </tr>
                                        <tr>
                                            <td>&nbsp;</td>
                                        </tr>
                                    </table>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-1"></label>
                                    <table>
                                        <tr>
                                            <td>
                                                <h4>房源详细描述</h4>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <hr/>

                                <label class="col-sm-1 control-label"></label>
                                <table>
                                    <tr>
                                        <td valign="top">
                                            【核心卖点】：
                                        </td>
                                        <td width="800px">
                                            <div class="col-sm-10">
                                                    ${houseDesc0.text}
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td valign="top">
                                            【出售原因】：
                                        </td>
                                        <td width="800px">
                                            <div class="col-sm-10">
                                                    ${houseDesc1.text}
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td valign="top">
                                            【景观特点】：
                                        </td>
                                        <td width="800px">
                                            <div class="col-sm-10">
                                                    ${houseDesc2.text}
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td valign="top">
                                            【坐落位置】：
                                        </td>
                                        <td width="800px">
                                            <div class="col-sm-10">
                                                    ${houseDesc3.text}
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                                &nbsp;
                                <fieldset>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">房源图片</label>

                                        <div class="col-sm-6">
                                            <div id="photos" class="row" style="width:750px">
                                                <c:if test="${photoList!= null || fn:length(photoList) == 0}">
                                                    <c:forEach items="${photoList}" var="item" varStatus="plist">
                                                        <div id="${item.photoUrl}-id" class="col-xs-4"><img
                                                                id="${item.photoUrl}"
                                                                src="${storeUrl}${item.photoUrl}">

                                                            <div class="q-label"><input value="${item.photoDesc}"></div>
                                                        </div>
                                                    </c:forEach>
                                                </c:if>
                                            </div>
                                        </div>
                                    </div>
                                </fieldset>
                                <br>
                                <fieldset>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">户型图片</label>

                                        <div class="col-sm-6">
                                            <div id="photos-hx" class="row" style="width:750px">
                                                <c:if test="${photoList!= null || fn:length(photoList) == 0}">
                                                    <c:forEach items="${photoHXList}" var="item" varStatus="plist">
                                                        <div id="${item.photoUrl}-id" class="col-xs-4"><img
                                                                id="${item.photoUrl}"
                                                                src="${storeUrl}${item.photoUrl}">

                                                            <div class="q-label"><input value="${item.photoDesc}"></div>
                                                        </div>
                                                    </c:forEach>
                                                </c:if>
                                            </div>
                                        </div>
                                    </div>
                                </fieldset>
                                <fieldset>
                                    <div>
                                        <label class="col-sm-2 control-label">房源状态</label>
                                        <form:select path="houseStatus" class="col-sm-2" disabled="true">
                                            <c:forEach items="${fns:getDictList('house_status')}" var="item">
                                                <option value="${item.name}"
                                                        <c:if test="${item.name == houseInfo.houseStatus}">selected</c:if>>${item.value}</option>
                                            </c:forEach>
                                        </form:select>
                                    </div>
                                </fieldset>
                            </fieldset>

                            <div class="form-actions center">
                                <button type="button" class="btn btn-sm btn-grey" id="go_back_btn">
                                    返回
                                    <i class="icon-reply icon-on-right bigger-110"></i>
                                </button>
                            </div>
                        </form:form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<%@include file="../common/page_content_suf.jsp" %>
<%@include file="../common/script.jsp" %>

<script type="text/javascript">
    $(document).ready(function () {
        $("#go_back_btn").on("click", function () {
            goBack();
        });
    });

    function goBack() {
        document.location.href = "${GLOBAL.basePath}/houseInfo/list";
    }
</script>
